package com.xxx.video.main.adapters;

import android.os.Bundle;

import androidx.annotation.NonNull;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentActivity;
import androidx.viewpager2.adapter.FragmentStateAdapter;

import com.xxx.video.main.fragments.FriendMessageFragment;
import com.xxx.video.main.fragments.SystemMessageFragment;

public class MessagePagerAdapter extends FragmentStateAdapter {
    public MessagePagerAdapter(@NonNull FragmentActivity fragmentActivity) {
        super(fragmentActivity);
    }

    @NonNull
    @Override
    public Fragment createFragment(int position) {
        if (position == 0) {
            return SystemMessageFragment.newInstance(new Bundle());
        }
        return FriendMessageFragment.newInstance(new Bundle());
    }

    @Override
    public int getItemCount() {
        return 2;
    }
}
